<template>
  <div>
    <van-card
      v-for="item in xwlist"
      :key="item.id"
      desc="描述信息"
      :title="item.title"
      :thumb="item.imageInput"
      @click="goinfo(item.id)"
    />
  </div>
</template>
<script>
export default {
  props: ["id"],
  data() {
    return {
      xwlist: [],
    };
  },
  methods: {
    async getlist() {
      // console.log(this.id.id);
      if (!this.id.id == "") {
        const res = await this.$http.zixunrm( this.id.id);
        
        this.xwlist = res.data.data.list;
        console.log(this.xwlist);
      } else {
        const res = await this.$http.zxlist();
        this.xwlist = res.data.data.list;
       
      }
     
    },
    // 跳转至新闻资讯详情
    goinfo(id){
      this.$router.push('/pages/news_details/index/id='+id)
    }
  },
  created() {
    // this.list()
    this.getlist();
  },
};
</script>
<style lang="scss" scoped>
</style>